<?php
if ($_REQUEST) {
    $a = $_REQUEST['username'];
    require_once 'dbconnect.php';
    $sql = mysql_query("SELECT posts.content, posts.when, movies.hun_title, posts.comment_id
            FROM posts 
            INNER JOIN users 
            ON posts.who=users.username
            INNER JOIN movies
            ON posts.what=movies.id
            WHERE users.username='$a';") or die(mysql_error());
    while ($rekord = mysql_fetch_array($sql)) {
        ?>
        <div class="comment_list" id="<?php echo $rekord['comment_id']; ?>">
            <div id="delete" onclick="delete_comment(<?php echo $rekord['comment_id']; ?>)">
                <img src="images/no.jpg"/>
            </div>
            <div class="comment_time"><?php echo $rekord['when']; ?></div>
            <div class="comment_on"><?php echo $rekord['hun_title']; ?></div>
            <div class="comment_what"><?php echo $rekord['content']; ?></div>
        </div>
        <?php
    }
}
?>